using NUnit.Framework;

namespace wMobinium.utility.test
{
    [TestFixture]
    public class DeviceSystemFolderTest
    {
        [Test]
        public void EnsureThatSystemFolderReplaceSystemFolderNameWithDevicePath()
        {
            Assert.AreEqual(@"\Program Files\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_PROGRAM_FILES%\OutlookTests.dll"));
            Assert.AreEqual(@"\Application Data\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_APPDATA%\OutlookTests.dll"));
            Assert.AreEqual(@"\OutlookTests.dll", DeviceSystemFolder.Replace(@"%CSIDL_COMMON_APPDATA%\OutlookTests.dll"));
            Assert.AreEqual(@"\Windows\Fonts\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_FONTS%\OutlookTests.dll"));
            Assert.AreEqual(@"\My Documents\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_PERSONAL%\OutlookTests.dll"));
            Assert.AreEqual(@"\Program Files\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_PROGRAM_FILES%\OutlookTests.dll"));
            Assert.AreEqual(@"\OutlookTests.dll", DeviceSystemFolder.Replace(@"\OutlookTests.dll"));
            Assert.AreEqual(@"\Windows\Start Menu\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_STARTMENU%\OutlookTests.dll"));
            Assert.AreEqual(@"\Windows\Start Menu\Programs\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_PROGRAMS%\OutlookTests.dll"));
            Assert.AreEqual(@"\Windows\Startup\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_STARTUP%\OutlookTests.dll"));
            Assert.AreEqual(@"\Windows\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"%CSIDL_WINDOWS%\OutlookTests.dll"));
            Assert.AreEqual(@"\Windows", DeviceSystemFolder.Replace(@"%CSIDL_WINDOWS%"));
        }

        [Test]
        public void EnsureThatSystemFolderDoesReturnsUnchangedFileNameIfNoSystemFolderNameExists()
        {
            Assert.AreEqual(@"\Program Files\OutlookTests.dll",
                            DeviceSystemFolder.Replace(@"\Program Files\OutlookTests.dll"));
        }
    }
}